package com.behelpful.common.core.utils;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneOffset;

/**
 * 日期工具类
 *
 * @author Alay
 * @date 2021-09-24 18:19
 */
public class IDateUtil {

    /**
     * 获取当天结束时间
     *
     * @param date
     * @return
     */
    public static LocalDateTime dayEnd(LocalDate date) {
        return LocalDateTime.of(date, LocalTime.MAX);
    }


    /**
     * 获取秒时间戳
     *
     * @param time
     * @return
     */
    public static long stampSecond(LocalDateTime time) {
        return time.toEpochSecond(ZoneOffset.of("+8"));
    }
}
